#include "mouse.h"
#include <QDebug>

Mouse::Mouse()
{
    accuracy = 6.0;
    setZValue(0);
}

void Mouse::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
                QWidget *widget) {
    QPen pen;
    QBrush brush;
    QColor color;
    color.setAlphaF(0.2);
    pen.setColor(color);
    color.setRgb(0,255,0);
    color.setAlphaF(0.2);
    brush.setColor(color);

    brush.setStyle(Qt::SolidPattern);
    painter->setPen(pen);
    painter->setBrush(brush);
    painter->drawEllipse(-accuracy, -accuracy, accuracy*2, accuracy*2);

}


QRectF Mouse::boundingRect() const
{
    return QRectF(-accuracy, -accuracy, accuracy*2, accuracy*2);
}

void Mouse::mousePressEvent(QMouseEvent *evt)
{
	qDebug() << "clicked";
    emit mousePressed(evt);
}

void Mouse::mouseReleaseEvent(QMouseEvent *evt)
{
	qDebug() << "released";
    emit mouseReleased(evt);
}
